/**
 * @param {number} n - a positive integer
 * @return {number} - a positive integer
 * @description 利用字符串解
 */

var reverseBits = function (n) {
    let str = n.toString(2)
    let len = str.length
    for (let i = 0; i < 32 - len; i++) {
        str = "0" + str
    }
    let res = str.split("").reverse().join("")
    // 将二进制转换为十进制
    return parseInt(res, 2)
};